<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link href="assets/css/bootstrap.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="css/style.css"/>
    <link href="assets/css/codemirror.css" rel="stylesheet">
    <link rel="stylesheet" href="assets/css/ace.min.css"/>
    <link rel="stylesheet" href="font/css/font-awesome.min.css"/>
    <!--[if lte IE 8]>
    <link rel="stylesheet" href="assets/css/ace-ie.min.css"/>
    <![endif]-->
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/typeahead-bs2.min.js"></script>
    <script src="assets/js/jquery.dataTables.min.js"></script>
    <script src="assets/js/jquery.dataTables.bootstrap.js"></script>
    <script src="assets/layer/layer.js" type="text/javascript"></script>
    <script src="assets/laydate/laydate.js" type="text/javascript"></script>
    <title>留言</title>
</head>

<body>
<div class="margin clearfix">
    <div class="Guestbook_style">
        <div class="border clearfix">
       <span class="l_f">
        <a href="toAddManagerPage" class="btn btn-warning" title="添加管理员"><i class="fa"></i> 添加管理员</a>
       </span>
            <%--            <span class="r_f">共：<b>2334</b>条</span>--%>
        </div>

        <div class="Guestbook_list">
            <table id="sample-table" class="table table-striped table-bordered table-hover">
                <thead>
                <tr>
                    <th width="50">id</th>
                    <th width="150">登录名称</th>
                    <th width="150">姓名</th>
                    <th width="80">性别</th>
                    <th width="300">电话</th>
                    <th width="300">邮箱</th>
                    <th width="300">QQ</th>
                    <th width="300">角色</th>
                    <th width="200">添加时间</th>
                    <th width="200">操作</th>
                </tr>
                </thead>
                <tbody>

                <c:forEach items="${list}" var="manager">
                    <tr>
                        <td>${manager.mgrId}</td>
                        <td>${manager.loginName}</td>
                        <td>${manager.mgrName}</td>
                        <td>${manager.mgrGender}</td>
                        <td>${manager.mgrTel}</td>
                        <td>${manager.mgrEmail}</td>
                        <td>${manager.mgrQQ}</td>
                        <td>${manager.roleName}</td>
                        <td>${manager.createTime}</td>

                        <td>
                            <a title="编辑" onclick="location.href='toUpdateManager?id='+${manager.mgrId}"
                               href="javascript:;" class="btn btn-xs btn-info"><i class="fa fa-edit bigger-120"></i></a>
                            <a title="删除" href="javascript:;" onclick="mgr_del(this,${manager.mgrId})"
                               class="btn btn-xs btn-warning"><i class="fa fa-trash  bigger-120"></i></a>


                        </td>
                    </tr>

                </c:forEach>


                </tbody>
            </table>
        </div>
    </div>
</div>
<%--<!--留言详细-->--%>
<%--<div id="Guestbook" style="display:none">--%>
<%--    <div class="content_style">--%>
<%--        <div class="form-group"><label class="col-sm-2 control-label no-padding-right"--%>
<%--                                       for="form-field-1">留言用户 </label>--%>
<%--            <div class="col-sm-9">胡海天堂</div>--%>
<%--        </div>--%>
<%--        <div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1">--%>
<%--            留言内容 </label>--%>
<%--            <div class="col-sm-9">--%>
<%--                三年同窗，一起沐浴了一片金色的阳光，一起度过了一千个日夜，我们共同谱写了多少友谊的篇章?愿逝去的那些闪亮的日子，都化作美好的记忆，永远留在心房。认识您，不论是生命中的一段插曲，还是永久的知已，我都会珍惜，当我疲倦或老去，不再拥有青春的时候，这段旋律会滋润我生命的每一刻。在此我只想说：有您真好!无论你身在何方，我的祝福永远在您身边!--%>
<%--            </div>--%>
<%--        </div>--%>
<%--        <div class="form-group"><label class="col-sm-2 control-label no-padding-right"--%>
<%--                                       for="form-field-1">是否回复 </label>--%>
<%--            <div class="col-sm-9">--%>
<%--                <label><input name="checkbox" type="checkbox" class="ace" id="checkbox"><span--%>
<%--                        class="lbl"> 回复</span></label>--%>
<%--                <div class="Reply_style">--%>
<%--                    <textarea name="权限描述" class="form-control" id="form_textarea" placeholder=""--%>
<%--                              onkeyup="checkLength(this);"></textarea>--%>
<%--                    <span class="wordage">剩余字数：<span id="sy" style="color:Red;">200</span>字</span>--%>
<%--                </div>--%>
<%--            </div>--%>
<%--        </div>--%>
<%--    </div>--%>
<%--</div>--%>
</body>
</html>
<script type="text/javascript">

    var oTable1 = $('#sample-table').dataTable({
        "aaSorting": [[1, "desc"]],//默认第几个排序
        "bStateSave": true,//状态保存
        "aoColumnDefs": [
            {"orderable": false, "aTargets": [0, 2, 3, 5, 6]}// 制定列不参与排序
        ]
    });


    function role_modify(id) {
        window.location.href = "admin_manager_update.html";
    }


    //删除
    function mgr_del(obj, id) {
        layer.confirm('确认要删除吗？', function (index) {
            $.ajax({
                url: "delManagerById",
                data: {"id": id},
                success: function () {

                    $(obj).parents("tr").remove();
                    layer.msg('已删除!', {icon: 1, time: 1000});
                    location.href = "findManagerAll";
                }
            });
        });
    }

</script>
